﻿using System.ServiceModel;
using CID.Execution.Support.PackageRegistration;
using NailsFramework;

namespace CID.Execution.Controller.PackageRegistration
{
    [ServiceContract(Namespace="http://cid.org/PackageRegistration/Web")]
    public sealed class WebPackageRegistrationService : PackageRegistrationServiceBase
    {
        public WebPackageRegistrationService() : base() { }

        [OperationContract]
        public void RegisterPackageByIDs(int componentId, int versionId, int packageTypeId, int responsibleId, byte[] content, string comments)
        {
            PackageRegistrator.RegisterPackage(componentId, versionId, packageTypeId, responsibleId, content, comments);
        }

        [OperationContract]
        public void RegisterPackageByNames(string componentName, string versionName, string packageTypeName, string responsibleUserName, byte[] content, string comments)
        {
            PackageRegistrator.RegisterPackage(componentName, versionName, packageTypeName, responsibleUserName, content, comments);
        }
    }
}
